﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using NakedObjects.Architecture.Adapter;
using NakedObjects.Architecture.Util;
using NakedObjects.Core.Persist;
using NakedObjects.Core.Context;
using RTC.Modelo.Entidades;

using FUFDomain.SystemStatus;
//using RTC.Modelo.Entidades;

namespace MVC.UFC
{
    public class SystemStatusHelper
    {
        public static String GetMessage(object domainObject)
        {

            //INakedObject nakedObject = null;
            //if (CollectionUtils.IsCollectionOrArray(domainObject.GetType()))
            //{
            //    nakedObject = PersistorUtils.CreateCollectionAdapter(domainObject);
            //}
            //else
            //{
            //    nakedObject = NakedObjectsContext.ObjectPersistor.GetAdapterFor(domainObject);
            //}
            
            //Entidad e = nakedObject.GetDomainObject<Entidad>();
            ////return e.GetSystemStatus().GetSystemStatusMessage();

            Object[] Servicios = NakedObjectsContext.ContributedActionsInstaller.GetServices();

            SystemStatus ss = (SystemStatus)Servicios[1];

            return ss.GetSystemStatusMessage();
        }
    }
}